/**
 * Program   :   ServiceException.java
 * Author    :   shadow guo
 * Create    :   2010-1-2 下午10:37:16
 *
 * Copyright 2008 by Tongfu Information Technology Co. Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of Tongfu Information Technology Co. Ltd. ("Confidential Information").  You
 * shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement
 * you entered into with Tongfu Information Technology Co. Ltd.
 * 
 */

/**
 * 
 */
package com.tongfusoft.exception;

/**
 * Service层公用的Exception.
 * 
 * 继承自RuntimeException,从被Spring声明式事务管理的函数中抛出时会触发事务回滚.
 * 
 * @author shadow guo
 */
public class ServiceException extends RuntimeException {

	private static final long serialVersionUID = 3583566093089790852L;
	/**
	 * 错误信息编号，记录到资源文件中。
	 */
	protected String errMsgCode;

	public ServiceException() {
		super();
	}
	
	public ServiceException(String message) {
		super(message);
	}

	public ServiceException(String message,String code) {
		super(message);
		this.errMsgCode = code;
	}

	public ServiceException(Throwable cause) {
		super(cause);
	}
	
	public ServiceException(Throwable cause,String code) {
		super(cause);
		this.errMsgCode = code;
	}

	public ServiceException(String message, Throwable cause) {
		super(message, cause);
	}
	
	public ServiceException(String message, Throwable cause,String code) {
		super(message, cause);
		this.errMsgCode = code;
	}

	public String getErrMsgCode() {
		return errMsgCode;
	}
	
	
}
